import unittest
from BSTestRunner import BSTestRunner
import time
if __name__ == '__main__':
    # 批量加载
    test_dir=r'../test_case'
    discover=unittest.defaultTestLoader.discover(test_dir,pattern='test*.py')
    #拼装测试报告文件
    report_dir=r'../reports_assert'
    now=time.strftime('%Y-%m-%d %H_%M_%S')
    report_name=rf'{report_dir}\{now}bsreport.html'
    # 执行并生成测试报告
    with open(report_name,'wb') as f:
        runner=BSTestRunner(f,title='测试报告',description='测试详情')
        runner.run(discover)
        